<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="webjars/jquery/3.6.4/jquery.min.js"></script>
    <link href="webjars/bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet">
    <script>
        $(function () {
            $(".btn-success").click(function () {
                $.post(
                    "save",
                    $("form").serialize(),
                    function (obj) {
                        if (obj) {
                            alert("新增成功！")
                            location = 'list'
                        }
                    }
                )
            })
        })
    </script>
</head>
<body>

          <div class="container">
               <form >

                    账号：<input type="text" name="name"><br>
                    密码:<input type="password" name="pwd"><br>
                    年龄：<input type="text" name="age"><br>
                    入职时间：<input type="text" name="in_time"><br>
                    地址：<input type="text" name="address"><br>
                     角色：<span th:each="role:${roles}" th:object="${role}">
                        <input type="checkbox" name="ids" th:value="*{rid}" th:text="*{rname}">&nbsp;
                      </span><br>
               </form>
              <button class="btn btn-success">新增</button>
          </div>

</body>
</html>
